#pragma once

#include "IManager.h"
#include "CFrame.h"
#include "CAnimation.h"
#include <vector>
#include <windows.h>
using namespace std;

class CAnimation;

class CAnimationManager
{
	vector<CAnimation*> m_vAnimations;
	int m_nAnimationCount;

	CAnimationManager();
	CAnimationManager(const CAnimationManager&);
	CAnimationManager& operator=(const CAnimationManager&);
	~CAnimationManager();
	CAnimation* Animate;

	int NumAnim;
	char* m_szAniName;
	int m_nTotalFrames;
	char* m_szImageFile;
	char* m_szTrigName;
	bool m_bIsLooping;
	int m_fFrameLength;
	RECT m_rRenderRect;
	RECT m_rAttackRect;
	RECT m_rCollisionRect;
	int m_nAnchorPointX;
	int m_nAnchorPointY;
	int m_nWeaponPointX;
	int m_nWeaponPointY;
	int m_nFrameCount;

	CFrame* Frame;

public:

	static CAnimationManager* GetInstance();

	void Init();
	void Clear();
	void Shutdown();
	void Load(const char* szFilePath);
	void Update(float fDelta, Animations* Anim);
	void Render(int nPosX, int nPosY, float fScale, DWORD dwColor, Animations* Anim, bool bIsFlipped);
	void AddAnimation(CAnimation* pAnimation);
	void RemoveAnimation(CAnimation* pAnimation);
};